#include <stdio.h>

int main() {
	int n = 0;
	scanf("%d", &n);
	int num[n] = {0};
	int num1[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &num[i]);
		num1[num[i]] += 1;
	}

	for (int i = 0; i < n; i++) {
		if (num1[i] == 1) {
			printf("%d", i);
			break;
		}
	}
	return 0;
}